﻿
using System.Collections;
using System.Web;

namespace Mitmar.Web.Mvc.DNN
{


    // This interface is used to abastact the HttpContext property bag (Items) cache
    // This is done to faciliate testing by providing the decoupling necesary
    public interface IContextCache
    {
        object this[string key] { get; set; }
        //Dictionary(Of String, Object)
        Hashtable Items { get; }
    }

    #region "ASPContextCache"

    public class ASPContextCache : IContextCache
    {

        public object this[string key]
        {
            get { return HttpContext.Current.Items[key]; }
            set { HttpContext.Current.Items[key] = value; }
        }

        public Hashtable Items
        {
            get { return (Hashtable)HttpContext.Current.Items; }
        }
    }

    #endregion


}
